package com.zrl.ggkt.vod.controller;


import com.zrl.ggkt.result.R;
import com.zrl.ggkt.vod.service.VideoVisitorService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 视频来访者记录表 前端控制器
 * </p>
 *
 * @author zrl
 * @since 2022-08-15
 */
@Api(tags = "课程统计")
@RestController
@RequestMapping("/admin/vod/videoVisitor")
//@CrossOrigin
public class VideoVisitorController {

    @Autowired
    private VideoVisitorService videoVisitorService;

    //课程统计接口
    @GetMapping("findCount/{courseId}/{startDate}/{endDate}")
    public R findCount(@PathVariable Long courseId,
                       @PathVariable String startDate,
                       @PathVariable String endDate){
        Map<String,Object> map =
                videoVisitorService.findCount(courseId,startDate,endDate);
        return R.ok(map);
    }


}

